//获取应用实例
var app = getApp();

var FormCheckRule = {
	idCardRule1: /^[0-9]{14}([0-9]|X|x)$/,
	idCardRule2: /^[0-9]{17}([0-9]|X|x)$/,
	nameRule: /^[\u4e00-\u9fa5]{2,12}$/,
	telRule: /^[1]{1}[0-9]{10}$/,
	carNbrSufRule: /^[a-zA-Z]{1}[a-zA-Z0-9]{4}[a-zA-Z0-9\u4E00-\u9FA5]{1,2}$/,

	areaNameNullMessage:"请选择户籍",
	areaAddressNullMessage:"请选择所在地区",
	hkNameNullMessage:"请选择香港签注种类",
	checkService:"请阅读并同意《港澳通行证签注办理须知》",
	cardNbrNullMessage:"请输入身份证号",
	cardNbrErrorMessage:"请输入正确的身份证号",
	creditCodeErrorMessage:"组织机构代码或统一社会信用代码格式有误",
	creditCodeNullMessage:"请输入组织机构代码或统一社会信用代码",
	organizationNameNullMessage:"请输入单位组织机构名称",
	organizationNameErrorMessage:"请输入正确的单位组织机构名称",
	organizationAddressNameNullMessage: "请输入单位组织所在地",
	nameNullMessage: "请输入配偶姓名",
	passNullMessage: "请添加通行证",
	streetNullMessage:"请输入详细地址",
	streetMinNullMessage:"详细地址不能小于5个字符",
	evidenceSelection:"请选择交证方式",
	pointNameSelection:"请选择交证地点",
	contactNameNullMessage:"请输入收件人姓名",
	contactNameErrorMessage:"请输入正确的收件人姓名",
	cellNumNullMessage:"请输入收件人电话",
	cellNumErrorMessage:"请输入正确的收件人电话"
};

Page({
	data: {
		visaType: 1,  //1 自由 2湖南 3 商务 4 夫妻 5 深圳  *跟后台参数同步  选择的下标
		visaName: '广东省户籍居民往来港澳个人旅游再次签注', //默认签注文字
		bizProvinceId: '440000',  //省份ID，请求地区的种类
		isShowVisaList: false, //显示签注列表状态
		visaList:[],  //签注类别数据源
		isShowHKList: false,
		hkName: '请选择香港签注种类',  //默认文字
		hkSelection: -1, //返回后台选项参数

		hkData: [],  //香港类型数据源
		selectedIndex: 0, //通行证滑动的下标
		isShowAMList: false,
		amName: '请选择澳门签注种类',  //默认文字
		amSelection: -1, //返回后台选项参数
		amData: [],  //澳门类型数据源

		evidenceName: "请选择交证方式",
		evidenceSelection: -1,  //默认给取证方式
		evidenceData: [   //取证方式
			{times:1, timesName: "速递员上门收证",},
			{times:2, timesName: "办事处交证",}
		],

		pointName: "请选择交证地点",
		pointSelection: -1,  //返回后台选项参数
		pointData: [], //取证点

		//省，市，区，户籍选择
		area:"请选择户籍",
		areaStyle:"color: #ababab;font-size:34rpx",
		"address.provinceId": "",
		"address.cityId": "",
		"address.countyId":"",
		"address.provinceName":"",
		"address.cityName":"",
		"address.countyName":"",

		locationArea: "请选择所在地区",
		locationStyle: "color: #ababab;font-size:34rpx",
		"locationAreaProvinceId": "",
		"locationAreaCityId": "",
		"locationAreaCountyId": "",
		"locationAreaProvinceName": "",
		"locationAreaCityName": "",
		"locationAreaCountyName": "",

		//组织地选择
		organizationArea: '请选择单位组织所在地',
		organizationAreaStyle:"color: #ababab;font-size:34rpx",

		"organizationAddress.provinceId": "",
		"organizationAddress.cityId": "",
		"organizationAddress.countyId":"",
		"organizationAddress.provinceName":"",
		"organizationAddress.cityName":"",
		"organizationAddress.countyName":"",
		"address.street":"", //详情地址

		// 商务组织信息
		creditCode: "", //组织机构代码，信用代码
		organizationName: "", //组织机构名称
		needInvoice:0,  //是否勾选
		sliderInvoice:false, //是否需要签注发票
		sliderSensitive:false, //是否是敏感人员

		emsSitesList: [], //清远地区的紧急服务地址列表
		maskIsShow: false, //清远地区不能办理，提示mask
		emsNotAddress: '', //保存的完整收件人地址 ，用于清远地区mask
		passList: [],
    isCanScroll:true, //屏幕是否能够滑动
		isShowPoint:false, //默认取证点不显示，当选择取证方式为办事处领证就显示
		isNoticeShow:false,  //服务协议说明
		isShowFootNav:true,  //底部导航菜单
		num: 0 //订单数
	},

	/**
	 *  ajax获得签注类别
	 */
	getVisaType:function () {
		var that = this;
		var opt2 = {
			url: app.globalData.host+"/wx/ehk/qbpl.ajax",
			data: {},
			sucFn:function (result) {
				var visaList = [];
				var forensicsPointList = [];
				for(var i=0;i<result.body.bizList.length;i++){
					var bizList = result.body.bizList;
					if(bizList[i].bizType == 1&&bizList[i].bizProvinceId == 440000){
						visaList[i]={visaType: 1, visaName: bizList[i].bizShortName, bizFullName: bizList[i].bizFullName ,bizProvinceId: bizList[i].bizProvinceId}
					}else if(bizList[i].bizType == 1&&bizList[i].bizProvinceId == 430000){
						visaList[i]={visaType: 2, visaName: bizList[i].bizShortName, bizFullName: bizList[i].bizFullName ,bizProvinceId: bizList[i].bizProvinceId,forensicsPointList:bizList[i].forensicsPointList}
					}else if(bizList[i].bizType == 3){
						visaList[i]={visaType: 3, visaName: bizList[i].bizShortName, bizFullName: bizList[i].bizFullName ,bizProvinceId: bizList[i].bizProvinceId}
					}else if(bizList[i].bizType == 4){
						visaList[i]={visaType: 4, visaName: bizList[i].bizShortName, bizFullName: bizList[i].bizFullName ,bizProvinceId: bizList[i].bizProvinceId}
					}else if(bizList[i].bizType == 5){
						visaList[i]={visaType: 5, visaName: bizList[i].bizShortName, bizFullName: bizList[i].bizFullName ,bizProvinceId: bizList[i].bizProvinceId}
					}
				}
				/*
				*   进入页面签注类别给默认值签注省份
				* */
				for(var y=0;y<visaList.length;y++){
					if(visaList[y].visaType==2&&visaList[y].bizProvinceId==430000){
						forensicsPointList = visaList[y].forensicsPointList;
						break;
					}	else {
						forensicsPointList = [];
					}
				}
				that.setData({
					visaList: visaList,
					// visaName: visaList[0].bizFullName,
					// bizProvinceId: visaList[0].bizProvinceId,
					pointData: forensicsPointList  //取证点
				})
				//app.setStorageSync(app.globalData.callVisaSign,1)  //用于首页是否调用签注类别标记
				app.initHkHouse()
			}
		};
		app.ajax(opt2);

		//进入页面默认地区给默认值
		var postData={
			bizProvinceId: 440000,
			bizType: that.data.visaType
		}
		that.getRegionType(postData,postData.bizType==1?true:false,true) //获得香港 澳门种类  true 不显示一年多次  第三个参数为了每次选择签注类别，更新地区种类类别，地区都更新取第一位
	},

	//获得通行证走马灯
	getPass: function () {
		var that = this;
		var opt = {
			url: app.globalData.host+"/wx/ehk/qel.ajax",
			data: {},
			sucFn:function (result) {
				var hkmPassMsgList = [],
						passMsgList = result.body.hkmPassMsgList;
				for(var i=0;i<passMsgList.length;i++){
					var passMagList = {
						'passName': passMsgList[i].passName,
						'passCode': passMsgList[i].passCode,
						'id': passMsgList[i].id,
						'validateEnd': app.toYMDDate(passMsgList[i].validateEnd),
						'birthday': app.toYMDDate(passMsgList[i].birthday),
						'passNameX': passMsgList[i].passNameX,
						'passNameM': passMsgList[i].passNameM

					};
					hkmPassMsgList.push(passMagList);
				}

					that.setData({
						passList: hkmPassMsgList
					})
			}
		};
		app.ajax(opt);
	},

	//登录获取OPENID
	login: function (callBack) {
		if(!app.globalData.openId){
			wx.login({//调用登录接口
				success: function (res) {
					var opt = {//后台兑换openId
						url: app.globalData.host + "/wx/ehk/eo.ajax",
						data: {
							'code': res.code
						},
						sucFn: function (result) {
							app.globalData.openId = result.body.openId;
							callBack(result.body.openId)
						}
					};
					app.ajax(opt);
				}
			});
		}else {callBack(app.globalData.openId);
		}
	},

	onLoad: function (onLoad) {
		var that = this;
		this.login(function (openId) {
			if(!app.getStorageSync(app.globalData.callVisaSign)){   //其它页面进入去缓存，不用调用获取签注接口
				that.getVisaType() //签注类型列表
			}else if(app.getStorageSync(app.globalData.paySuccessSign)){  //到了支付成功页首页回复默认值
				that.setData({
					visaType: 1,  //1 自由 2湖南 3 商务 4 夫妻 5 深圳  *跟后台参数同步  选择的下标
					visaName: '广东省户籍居民往来港澳个人旅游再次签注', //默认签注文字
					bizProvinceId: '440000',  //省份ID，请求地区的种类

					isCanScroll: true,
					isShowVisaList: false,
					isShowFootNav: true,
					// 选择签注类别以下状态恢复默认值
					creditCode: "", //组织机构代码，信用代码
					organizationName: "", //组织机构名称

					evidenceName: "请选择取证方式",
					evidenceSelection: -1,  //默认给取证方式
					pointName: "请选择取证点",
					pointSelection: -1,  //返回后台选项参数
					isShowPoint: false,

					//省，市，区，户籍选择
					area:"请选择户籍",
					areaStyle:"color: #ababab;font-size:34rpx",
					"address.provinceId": "",
					"address.cityId": "",
					"address.countyId":"",
					"address.provinceName":"",
					"address.cityName":"",
					"address.countyName":"",

					cardNbr: "", //身份证
					name: "", //配偶姓名
					//组织地选择
					organizationArea: '请选择单位组织所在地',
					organizationAreaStyle:"color: #ababab;font-size:34rpx",

					"organizationAddress.provinceId": "",
					"organizationAddress.cityId": "",
					"organizationAddress.countyId":"",
					"organizationAddress.provinceName":"",
					"organizationAddress.cityName":"",
					"organizationAddress.countyName":""
				});
				that.getVisaType() //签注类型列表
			}
			that.getPass()  //通行证走马灯列表

		});
		app.initAddress();  //请求省市区数据

		if(app.globalData.openId){
			this.getUserInfo();
		}else {
			wx.login({//调用登录接口
				success: function (res) {
					var opt = {//后台兑换openId
						url: app.globalData.host + "/wx/ehk/eo.ajax",
						data: {
							'code': res.code
						},
						sucFn: function (result) {
							app.globalData.openId = result.body.openId;
							that.getUserInfo();
						}
					};
					app.ajax(opt);
				}
			});
		}
	},

	//获得用户信息
	getUserInfo: function () {
		var that = this;
		var opt2 = {
			url: app.globalData.host+"/wx/ehk/list.ajax",
			data: {
				'accountId':app.globalData.openId,
				'bizFlag':app.globalData.bizDoingFlag,
				'orderType':app.globalData.orderType
			},
			sucFn:function (result) {
				var num = "";
				if(result.body.orderList.length!=0){
					num = result.body.orderList.length;
				}
				that.setData({
					"num": num
				});
			}
		};
		app.ajax(opt2);
	},

	//签注发票
	switchChange: function (e) {
		var sliderInvoice = e.detail.value;
		this.setData({sliderInvoice: sliderInvoice});
	},

	//是否是敏感人员
	switchChangeSensitive: function (e) {
		var sliderSensitive = e.detail.value;
		this.setData({sliderSensitive: sliderSensitive});
	},

	//是否勾选协议
	checkTap:function (e) {
		var needInvoice = e.target.dataset.agree;
		if(needInvoice==0){
			needInvoice = 1;
		}else{
			needInvoice = 0;
		}
		this.setData({needInvoice: needInvoice});
	},

	//分享功能
	onShareAppMessage: function () {
		return {
			title: '港澳通行证签注办理',
			desc: '港澳通行证签注办理',
			path: '/pages/handle/handle'
		}
	},

	onLaunch: function(options) {
	},

	onHide:function () {
		app.setStorageSync(app.globalData.cacheData,Object.assign({},this.data,{ popErrorMsg: '' },{errorScrollIntoViewName: ''},
			{errorFocusName:''},{scrollTop: 0},{isCanScroll: true})); //保存状态在缓存

	  app.removeStorage('addPass') //添加通行证保存的缓存，当用户保存通行证返回页面走马灯应该滑动到添加的位置
		app.removeStorage(app.globalData.paySuccessSign);  //支付成功页标记

		// app.removeStorageSync(app.globalData.callVisaSign)  //是否需要调用签注类别
	},

	onShow:function () {
		var page = app.getStorageSync(app.globalData.cacheData);

		this.setData(Object.assign({},page,
			app.getStorageSync('addPass')? {
					selectedIndex: app.getStorageSync('addPass')?0:this.data.selectedIndex
				}:{}
		));
		this.onLoad();
	},

	//底部切换页面方法
	mineTap:function (e) {
		app.setStorageSync(app.globalData.cacheData,this.data);
		var url = e.currentTarget.dataset.url;
		app.redirectTo({url: url});
	},

	idCardTap:function (e) {
		//当前页面的tag
	},

	//保存缓存
	saveCache:function(){
		app.setStorageSync(app.globalData.cacheData,this.data);
	},

	//确认提交按钮
  formSubmit:function(e){
		var formData = e.detail.value;
		var cardNbr = formData.cardNbr;
		var creditCode = formData.creditCode;
		var organizationName = formData.organizationName;
		var name = formData.name;
		var street = formData['address.street'];
		var provinceId = formData['address.provinceId']; //户籍
		var organizationAddress = formData['organizationAddress.provinceId'];//组织地
	  var recipientName = formData.recipientName; //收件姓名
	  var cardNumber = formData.cardNumber; //收件人电话号码
		var locationAreaProvinceId = formData['locationAreaProvinceId'];//收件人地址

		var needInvoice = formData.needInvoice; //协议
		var pageObj = this;
		var currentPass=this.data.passList[this.data.selectedIndex];

	  var address={
		  id: formData.locationAreaProvinceId,  //地址id，数据库主键标识
		  provinceId: formData.locationAreaProvinceId,   //省份id
		  cityId: formData.locationAreaCityId, //地市id
		  countyId: formData.locationAreaCountyId,//区县id  441825 不能办理
		  street: formData["address.street"], //街道详细地址
		  fullAddr: formData.locationAreaProvinceName+formData.locationAreaCityName+formData.locationAreaCountyName, //'广东省清远市 连山壮族瑶族自治县 我们自己都江堵救灾', //完整地址
		  contactName: formData.recipientName, //收件人
		  cellNum: formData.cardNumber  //收件人联系号码

	  };

	  /*
	   *   // category 目的地类型：1-香港，2-澳门
	   *  //  times  周期次数：1:三月一次;2:三月两次;3:三月多次;4:一年一次;5:一年两次;6:一年多次
	   *  //1 自由 2湖南 3 商务 4 夫妻 5 深圳  *跟后台参数同步  选择的下标
	   * */
	  var state = this.data;
	  var categoryType=state.visaType == '3'?
		  [{category: 1, times: state.hkSelection,timesName: state.hkName}] :

		  state.visaType=='1'&&state.hkSelection==-1?
		  [{category: 2, times: state.amSelection ,timesName: state.amName}] :
			  state.visaType=='1'&&state.amSelection==-1?
		  [{category: 1, times: state.hkSelection ,timesName: state.hkName}] :

		  state.visaType=='2'&&state.hkSelection==-1?
		  [{category: 2, times: state.amSelection ,timesName: state.amName}] :
		  state.visaType=='2'&&state.amSelection==-1?
		  [{category: 1, times: state.hkSelection ,timesName: state.hkName}] :

			  state.visaType=='4'&&state.hkSelection==-1?
		  [{category: 2, times: state.amSelection,timesName: state.amName}] :
			  state.visaType=='4'&&state.amSelection==-1?
		  [{category: 1, times: state.hkSelection,timesName: state.hkName}] :

			  state.visaType=='5'&&state.hkSelection==-1?
		  [{category: 2, times: state.amSelection,timesName: state.amName}] :
			  state.visaType=='5'&&state.amSelection==-1?
		  [{category: 1, times: state.hkSelection,timesName: state.hkName}] :

		  [{category: 1, times: state.hkSelection,timesName: state.hkName},
			  {category: 2, times: state.amSelection,timesName: state.amName}];

	  if(currentPass == undefined){  //判断通行证是否为空
	  	app.errorToast(FormCheckRule.passNullMessage);
		  pageObj.setData({scrollTop: 0})
		  return;
	  }

	  if(this.data.visaType==2||this.data.visaType==4||this.data.visaType==5){  //2 湖南 4夫妻 5 深圳
		  var flag = app.check([
			  {
				  value: provinceId,
				  errorFocusName:"provinceId",
				  errorScrollIntoViewName:"areaInfo",
				  fn: function(value){
					  if(value == ''){
						  app.errorToast(FormCheckRule.areaNameNullMessage);
						  return false;
					  }else {
						  return true;
					  }
				  }
			  },{
				  value: cardNbr,  //身份证
				  errorFocusName:"cardNbr",  //input获得焦点
				  errorScrollIntoViewName:"areaInfo",
				  fn: function(value){
					  if(''==value){
						  app.errorToast(FormCheckRule.cardNbrNullMessage);
						  return false;
					  }else if( value.length == 15 && FormCheckRule.idCardRule1.test(value)) {
						  return true;
					  } else if (value.length == 18 && FormCheckRule.idCardRule2.test(value)) {
						  return true;
					  } else{
						  app.errorToast(FormCheckRule.cardNbrErrorMessage);
						  return false;
					  }
				  }
			  }
		  ]);
		  if (!flag) {
			  return false;
		  }
	  }
	  /*
	   *  个人自由行类型
	   * */

	  if(this.data.visaType==1){
		  var flag = app.check([
			  {
				  value: provinceId,
				  errorFocusName:"provinceId",
				  errorScrollIntoViewName:"areaInfo",
				  fn: function(value){
					  if(value == ''){
						  app.errorToast(FormCheckRule.areaNameNullMessage);
						  return false;
					  }else {
					  	return true;
					  }
				  }
			  }
		  ]);
		  if (!flag) {
			  return false;
		  }
	  }else if(this.data.visaType==2){
		  var flag = app.check([
			  {
				  value: this.data.evidenceName,
				  errorFocusName:"evidenceName",
				  errorScrollIntoViewName:"areaInfo",
				  fn: function(value){
					  if(value == '请选择交证方式'){
						  app.errorToast(FormCheckRule.evidenceSelection);
						  return false;
					  }else if(value == '办事处交证'){
							if(pageObj.data.pointName == '请选择交证地点'){
								app.errorToast(FormCheckRule.pointNameSelection);
								return false;
							}else {
								return true;
							}
					  }else {
						  return true;
					  }
				  }
			  }
		  ]);
		  if (!flag) {
			  return false;
		  }
	  }else if(this.data.visaType==3){ //商务
		  var flag = app.check([
			  {
				  value: cardNbr,  //身份证
				  errorFocusName:"cardNbr",  //input获得焦点
				  errorScrollIntoViewName:"areaInfo",
				  fn: function(value){
					  if(''==value){
						  app.errorToast(FormCheckRule.cardNbrNullMessage);
						  return false;
					  }else if( value.length == 15 && FormCheckRule.idCardRule1.test(value)) {
						  return true;
					  } else if (value.length == 18 && FormCheckRule.idCardRule2.test(value)) {
						  return true;
					  } else{
						  app.errorToast(FormCheckRule.cardNbrErrorMessage);
						  return false;
					  }
				  }
			  },{
				  value: creditCode,  //机构代码
				  errorFocusName: "creditCode",  //input获得焦点
				  errorScrollIntoViewName: "areaInfo",
				  fn: function(value){
					  if(''==value){
						  app.errorToast(FormCheckRule.creditCodeNullMessage);
						  return false;
					  } else if(value.length==9||value.length==18) {
						  return true;
					  }
					  else{
						  app.errorToast(FormCheckRule.creditCodeErrorMessage);
						  return false;
					  }
				  }
			  },{
				  value: organizationName,  //机构名称
				  errorFocusName: "organizationName",  //input获得焦点
				  errorScrollIntoViewName: "areaInfo",
				  fn: function(value){
					  if(''==value){
						  app.errorToast(FormCheckRule.organizationNameNullMessage);
						  return false;
					  }else if(value.length<2){
						  app.errorToast(FormCheckRule.organizationNameErrorMessage);
						  return false;
					  }else{
						  return true;
					  }
				  }
			  },{
				  value: organizationAddress,   //组织地址
				  errorScrollIntoViewName:"areaInfo",
				  fn: function(value){
					  if(value == ''){
						  app.errorToast(FormCheckRule.organizationAddressNameNullMessage);
						  return false;
					  }else {
						  return true;
					  }
				  }
			  },
		  ]);
		  if (!flag) {
			  return false;
		  }
	  }else if(this.data.visaType==4){  //夫妻
		  var flag = app.check([
			  {
				  value: name,
				  errorFocusName:"name",
				  errorScrollIntoViewName:"areaInfo",
				  fn: function(value){
					  if(value == ''){
						  app.errorToast(FormCheckRule.nameNullMessage);
						  return false;
					  }else {
						  return true;
					  }
				  }
			  }
		  ]);
		  if (!flag) {
			  return false;
		  }
	  }
	 if(this.data.hkSelection==-1&&this.data.amSelection==-1){  //香港和澳门可二选一
	  	app.errorToast(FormCheckRule.hkNameNullMessage);
		  this.setData({
			  errorScrollIntoViewName:"areaInfo"
		  })
		  return;
	  }else if(recipientName==''){  //收件人姓名
		 this.setData({
		  errorScrollIntoViewName:"addressSign",
		  errorFocusName: "recipientName"
		 });
		 app.errorToast(FormCheckRule.contactNameNullMessage);
		 return;
	 }else if(!FormCheckRule.nameRule.test(recipientName)){//收件人姓名
		 pageObj.setData({
			 errorScrollIntoViewName:"addressSign",
		   errorFocusName: "recipientName"
		 });
		 app.errorToast(FormCheckRule.contactNameErrorMessage);
		 return;
	 }else if(cardNumber==''){ //收件人手机号码
		 pageObj.setData({
			 errorScrollIntoViewName:"addressSign",
		   errorFocusName: "contactNumber"
		 });
		 app.errorToast(FormCheckRule.cellNumNullMessage);
		 return;
	 }else if(!FormCheckRule.telRule.test(cardNumber)){//收件人手机号码
		 pageObj.setData({
			 errorScrollIntoViewName:"addressSign",
			 errorFocusName: "contactNumber"
		 });
		 app.errorToast(FormCheckRule.cellNumErrorMessage);
	 }else if(locationAreaProvinceId==''){  //收件人所在地
		 pageObj.setData({
			 errorScrollIntoViewName:"addressSign",
		 })
		 app.errorToast(FormCheckRule.areaAddressNullMessage);
		 return;
	 } else if(street==''){
		 this.setData({
			 errorScrollIntoViewName:"addressSign",
		   errorFocusName:'street'
		 });
		 app.errorToast(FormCheckRule.streetNullMessage);
		 return;
	   }else if(street.length<5){  //详细地址
		 this.setData({
			 errorScrollIntoViewName:"addressSign",
			 errorFocusName:'street'
		 });
		 app.errorToast(FormCheckRule.streetMinNullMessage);
		 return;
	 }else if(needInvoice==0){		 //是否勾选协议
		 app.errorToast(FormCheckRule.checkService);
		  this.setData({
			  errorScrollIntoViewName:"organizationAddress"
		  })
		  return;
	  }

	  var enObj = "";
	  switch (state.visaType){
		  case 1:
			  enObj = {
				  type: 1,
				  passId: currentPass.id, //证件id,
				  passCode: currentPass.passCode, //证件号码
				  passName: currentPass.passName,  //证件人名称
				  passNameX: currentPass.passNameX,  //证件人名称，姓
				  passNameM: currentPass.passNameM,  //证件人名称，名
				  birthday: currentPass.birthday, //生日
				  validateEnd: currentPass.validateEnd, //有效期

				  bizProvinceId: this.data.bizProvinceId,  //签注类型省份ID
				  provinceId: formData['address.provinceId'], //省份ID
				  cityId: formData['address.cityId'], //户籍所属城市ID
				  countyId: formData['address.countyId'], //户籍所属地区ID
				  birthPlace:formData['address.provinceName']+formData['address.cityName']+formData['address.countyName'], //户籍所在地+++
				  needInvoice: this.data.sliderInvoice?1:0 //是否需要发票  1-需要 0-不需要
			  };
			  break;
		  case 2:
			  enObj = {
				  type: 1,
				  passId: currentPass.id, //证件id,
				  passCode: currentPass.passCode, //证件号码
				  passName: currentPass.passName,  //证件人名称
				  passNameX: currentPass.passNameX,  //证件人名称，姓
				  passNameM: currentPass.passNameM,  //证件人名称，名
				  birthday: currentPass.birthday, //生日
				  validateEnd: currentPass.validateEnd, //有效期

				  idCardNo: state.cardNbr, //身份证号码
				  bizProvinceId: this.data.bizProvinceId,  //签注类型省份ID
				  provinceId: formData['address.provinceId'], //省份ID
				  cityId: formData['address.cityId'], //户籍所属城市ID
				  countyId: formData['address.countyId'], //户籍所属地区ID
				  birthPlace:formData['address.provinceName']+formData['address.cityName']+formData['address.countyName'], //户籍所在地+++
				  needInvoice: this.data.sliderInvoice?1:0, //是否需要发票  1-需要 0-不需要
				  sensitiveMan: state.sliderSensitive?2:1, //是否是铭感人群
				  getCardWay: state.evidenceSelection,  //1为快递员收件  2为取证点收件
				  getCardPlaceCode: state.evidenceSelection==1?'':state.pointSelection, //取证点code
				  getCardPlaceName:  state.evidenceSelection==1?'':state.pointName  //1:广州办事处 2:深圳办事处 3:珠海办事处

			  };
			  break;
		  case 3:
			  enObj={
				  type: 3,
				  passId: currentPass.id, //证件id,
				  passCode: currentPass.passCode, //证件号码
				  passName: currentPass.passName,  //证件人名称
				  passNameX: currentPass.passNameX,  //证件人名称，姓
				  passNameM: currentPass.passNameM,  //证件人名称，名
				  birthday: currentPass.birthday, //生日
				  validateEnd: currentPass.validateEnd, //有效期

				  idCardNo: state.cardNbr, //身份证号码
				  orgNbr: state.creditCode, //组织机构代码，只在选择商务出行时生效
				  orgName: state.organizationName, //组织名称

				  bizProvinceId: this.data.bizProvinceId,  //签注类型省份ID
				  provinceId: formData['organizationAddress.provinceId'], //组织地省份ID
				  cityId: formData['organizationAddress.cityId'], //组织地所属城市ID
				  countyId: formData['organizationAddress.countyId'], //组织地所属地区ID
				  orgPlace: formData['organizationAddress.provinceName']+formData['organizationAddress.cityName']+formData['organizationAddress.countyName'], //组织所在地

				  needInvoice: this.data.sliderInvoice?1:0 //是否需要发票  1-需要 0-不需要
			  }
			  break;
		  case 4:
			  enObj={
				  type: 4,
				  passId: currentPass.id, //证件id,
				  passCode: currentPass.passCode, //证件号码
				  passName: currentPass.passName,  //证件人名称
				  passNameX: currentPass.passNameX,  //证件人名称，姓
				  passNameM: currentPass.passNameM,  //证件人名称，名
				  birthday: currentPass.birthday, //生日
				  validateEnd: currentPass.validateEnd, //有效期

				  bizProvinceId: this.data.bizProvinceId,  //签注类型省份ID
				  provinceId: formData['address.provinceId'], //省份ID
				  cityId: formData['address.cityId'], //户籍所属城市ID
				  countyId: formData['address.countyId'], //户籍所属地区ID
				  birthPlace: formData['address.provinceName']+formData['address.cityName']+formData['address.countyName'], //户籍所在地+++
				  needInvoice: this.data.sliderInvoice?1:0, //是否需要发票  1-需要 0-不需要

				  idCardNo: state.cardNbr, //身份证号码
				  spouseName: state.name //配偶姓名，只在选择夫妻探亲时生效

			  }
			  break;
		  case 5:
			  enObj={
				  type: 5,
				  passId: currentPass.id, //证件id,
				  passCode: currentPass.passCode, //证件号码
				  passName: currentPass.passName,  //证件人名称
				  passNameX: currentPass.passNameX,  //证件人名称，姓
				  passNameM: currentPass.passNameM,  //证件人名称，名
				  birthday: currentPass.birthday, //生日
				  validateEnd: currentPass.validateEnd, //有效期

				  bizProvinceId: this.data.bizProvinceId,  //签注类型省份ID
				  provinceId: formData['address.provinceId'], //省份ID
				  cityId: formData['address.cityId'], //户籍所属城市ID
				  countyId: formData['address.countyId'], //户籍所属地区ID
				  birthPlace: formData['address.provinceName']+formData['address.cityName']+formData['address.countyName'], //户籍所在地+++
				  needInvoice: this.data.sliderInvoice?1:0, //是否需要发票  1-需要 0-不需要
				  idCardNo: state.cardNbr //身份证号码
			  }
			  break;
	  }

	  var post = {
		  endorseInfoList: [{
			  "endorseInfoObj": JSON.stringify(enObj),
			  "address": JSON.stringify(address),
			  "items": JSON.stringify(categoryType)
		  }]
	  };
	  var formResult = {
		  objStr: JSON.stringify(post)
	  };

	  var opt = {
		  url: app.globalData.host+"/wx/ehk/handling.ajax",
		  data: formResult,
		  sucFn:function (result) {
		  	if(!result.body.canHandler){
				  pageObj.setData({
					  emsSitesList: result.body.emsSites,
					  emsNotAddress : address.fullAddr,
					  maskIsShow: true
				  })
			  }else {
				  result['payData']= formResult.objStr;
				  app.setStorageSync(app.globalData.cacheOrderPay, result);
				  app.navigateTo({url:'../payment/payment'})
			  }

		  }
	  };
	  app.ajax(opt);
	},

	//说明内容
	agreeTap:function (e) {
		//visaType: 1,  //1 自由 2湖南 3 商务 4 夫妻 5 深圳   free个人自由行 again商务  spouse夫妻  sz深圳*跟后台参数同步  选择的下标
		switch (this.data.visaType){
			case 1:
				this.setData({isNoticeShow:'free'})
				break;
			case 2:
				this.setData({isNoticeShow:'free'})
				break;
			case 3:
				this.setData({isNoticeShow:'again'})
				break;
			case 4:
				this.setData({isNoticeShow:'spouse'})
				break;
			case 5:
				this.setData({isNoticeShow:'sz'})
				break;
		}
		this.setData({
			isShowFootNav: false
		});
	},

	//隐藏协议说明内容
	noticeKnowTap:function (e) {
		this.setData({
			isNoticeShow:false,
			isShowFootNav: true
		});
	},

	//输入框公用方法
	infoInput: function(e){
		var id = e.currentTarget.id,
	      value = e.detail.value;
		if(id=="cardNbr"){  //身份证号
			value = value.substr(0, 18);
			var cardNbrValue = value.replace(/(^\s*)|(\s*$)/g,"");
			this.setData({"cardNbr": cardNbrValue.replace('x','X')});
			if(cardNbrValue==''|| cardNbrValue.length == 15 && FormCheckRule.idCardRule1.test(cardNbrValue)) {
				this.setData({"cardNbrIconType": "success"});
			} else if (cardNbrValue==''||cardNbrValue.length == 18 && FormCheckRule.idCardRule2.test(cardNbrValue)) {
				this.setData({"cardNbrIconType": "success"});
			} else if(cardNbrValue.length>0){
				this.setData({"cardNbrIconType": "error"});
			}else{
				this.setData({"cardNbrIconType": ""});
			}

		}else if(id == "creditCode"){  //组织机构代码
			var creditCodeValue = value.replace(/(^\s*)|(\s*$)/g,"");
			this.setData({creditCode: value.replace(/[^\w\.\/]/ig,"")});  //限制只能输入字母和数字
			if(creditCodeValue==''||creditCodeValue.replace(/[^\w\.\/]/ig,"").length==9||creditCodeValue.replace(/[^\w\.\/]/ig,"").length==18){
				this.setData({creditCodeIconType: "success"});
			}else if(value.length >0){
				this.setData({creditCodeIconType: "error"});
			}else {
				this.setData({
					creditCodeIconType: "",
					creditCode: creditCodeValue
				});
			}
		}else if(id == "organizationName"){  //组织机构名称
			var organizationName = value.replace(/(^\s*)|(\s*$)/g,"");
			this.setData({organizationName: organizationName});
			if(organizationName==''||organizationName.length>1) {
				this.setData({organizationNameIconType: "success"});
			}else if(organizationName.length<2){
				this.setData({organizationNameIconType: "error"})
			}else {
				this.setData({
					organizationNameIconType: "",
					organizationName: organizationName
				});
			}
		}else if(id == "name"){  //配偶姓名
			var name = value.replace(/(^\s*)|(\s*$)/g,"");
			this.setData({name: name});
			if (name==''||FormCheckRule.nameRule.test(name)) {
				this.setData({nameIconType: "success"});
			} else if (value.length > 0) {
				this.setData({nameIconType: "error"});
			}else {
				this.setData({nameIconType: ""});
			}
		}else if(id == "recipientName"){  //收件人姓名
			var recipientName = value.replace(/(^\s*)|(\s*$)/g,"");
			this.setData({recipientName: recipientName});
			if (recipientName==''||FormCheckRule.nameRule.test(recipientName)) {
				this.setData({recipientNameIconType: "success"});
			} else if (value.length > 0) {
				this.setData({recipientNameIconType: "error"});
			}else {
				this.setData({recipientNameIconType: ""});
			}
		}else if(id == "contactNumber"){ //收件人联系电话
			value = value.substr(0, 11);
			var contactNumber = value.replace(/(^\s*)|(\s*$)/g,"");
			this.setData({contactNumber: contactNumber});
			if (contactNumber==''||FormCheckRule.telRule.test(contactNumber)) {
				this.setData({urgentLinkTelIconType: "success"});
			} else if (value.length > 0) {
				this.setData({urgentLinkTelIconType: "error"});
			} else {
				this.setData({urgentLinkTelIconType: ""});
			}

		}else if(id == "address.street"){ //详细信息
			var street = value.replace(/(^\s*)|(\s*$)/g,"");
			this.setData({"address.street": street});
			if(street==''||value.length>4){
				this.setData({streetNameIconType: "success"});
			} else if(value.length>0){
				this.setData({streetNameIconType: "error"})
			}else {
				this.setData({streetNameIconType: ""})
			}
		}
	},

	//滑动获取通行证走马灯下标
	sliderChange: function (e) {
		this.setData({
			selectedIndex: e.detail.current
		})
	},

	//点击通行证跳入通行证页
	sliderToUrl: function (e) {
		app.navigateTo({url:'../addpass/addpass?id='+e.currentTarget.dataset.id+'&type='+e.currentTarget.dataset.type})
	},

	//回复默认状态
	//this.isClickVisaType true为点击获取签注类型，false 为接口默认取一个签注类型
	recoveryDefaultState: function (e) {
		this.setData({
			isCanScroll: true,
			isShowVisaList: false,
			isShowFootNav: true,

			visaName: e.target.dataset.name,
			visaType: e.target.dataset.type,
			bizProvinceId: e.target.dataset.provinceid,
			//省，市，区，户籍选择
			area:"请选择户籍",
			areaStyle:"color: #ababab;font-size:34rpx",
			// cardNbr: "", //身份证
			// name: "", //配偶姓名
			"address.provinceId": "",
			"address.cityId": "",
			"address.countyId":"",
			"address.provinceName":"",
			"address.cityName":"",
			"address.countyName":""
		});
	},

	/*选择签注类别列表 start*/
	//选择签注类别列表
  showVisaListTap: function(e){
  	this.recoveryDefaultState(e)
		var postData={
			bizProvinceId: e.target.dataset.provinceid,
			bizType: e.target.dataset.type
		}
    app.initHkHouse();
		this.getRegionType(postData,postData.bizType==1?true:false,true) //获得香港 澳门种类  true 不显示一年多次  第三个参数为了每次选择签注类别，更新地区种类类别，地区都更新取第一位
	},

	/*
	 *   区分香港 澳门列表
	 *   check 选择签注类别签注种类也要更新
	 * */

	getRegionType:function(postData,type,check){   //type为false显示深圳一年多次 修改签注类别check 为true
		var that = this;
		if(!check){check=false}
		if(postData.bizType==2&&postData.bizProvinceId==430000){
			postData = {
				bizType: 1,
				bizProvinceId: 430000
			}
		}
		var opt = {//后台兑换openId
			url: app.globalData.host + "/wx/ehk/qcbl.ajax",
			data: postData,
			sucFn: function (result) {
				var chargeData = result.body.chargeRuleList;
				var amData=[], hkData=[];
				for(var i=0;i<chargeData.length;i++){
					if(chargeData[i].category==1){ //香港
						if(type){
							if(chargeData[i].times!=6) {
								hkData.push(chargeData[i])  //没有一年多次*6
							}
						}else {
							hkData.push(chargeData[i])  //有一年多次
						}
					}else {
						amData.push(chargeData[i])  //澳门
					}
				}

				if(that.data.visaType==1||that.data.visaType==2||that.data.visaType==5){
					if(that.data.amName == '请选择澳门签注种类'&&that.data.hkName == '请选择香港签注种类'||check){ //check是切换签注类别，地区种类都取第一位
						that.setData({
							amName: amData[0]&&amData[0].timesName,
							hkName: amData[0]&&hkData[0].timesName,   //商务游不给默认值
							amSelection: 4,  //一年一次times:4
							hkSelection: 4,   //一年一次times:4
							hkData: hkData, //香港数据源
							amData: amData //澳门数据源
						})
					}else {
						that.setData({
							hkData: hkData,  //香港数据源
							amData: amData  //澳门数据源
						})
						for(var i=0;i<hkData.length;i++){   //根据本地字段和后台返回数据匹配，获得候选状态, 每次切换 香港地区有可能有一年多次，所以要动态去下标
							if(that.data.hkName == hkData[i].timesName){
								that.setData({
									hkSelection: hkData[i].times
								})
							}
						}
					}
				}else {
					if(that.data.amName=='请选择澳门签注种类'&&that.data.hkName=='请选择香港签注种类'||check){
						that.setData({
							hkName: '请选择香港签注种类',
							hkSelection: -1, //选择的选项
							amName: '请选择澳门签注种类',
							amSelection: -1, //选择的选项
							hkData: hkData,  //香港数据源
							amData: amData  //澳门数据源
						})
					}else {
						that.setData({
							hkData: hkData,  //香港数据源
							amData: amData  //澳门数据源
						})

						for(var i=0;i<hkData.length;i++){   //根据本地字段和后台返回数据匹配，获得候选状态, 每次切换 香港地区有可能有一年多次，所以要动态去下标
							if(that.data.hkName == hkData[i].timesName){
								that.setData({
									hkSelection: hkData[i].times
								})
							}
						}
					}
				}
			}
		};
		app.ajax(opt);

	},

	//点击旅游签注图标显示旅游签注类别列表
	visaSelection: function(e){
		var that = this;
		setTimeout(function(){
			that.setData({
				isCanScroll:false,
				isShowVisaList: true,
				isShowFootNav: false
			});
		},50)
	},

  //点击mask隐藏旅游签注类别列表
	hideVisaSelection: function(){
		this.setData({
			isCanScroll:true,
			isShowVisaList: false,
			isShowFootNav: true
		});
	},

	//点击取证方式图标显示取证方式列表 start
	evidenceSelection: function (e) {
		var that = this;
		setTimeout(function(){
			that.setData({
				isCanScroll:false,
				isShowEvidenceList: true,
				isShowFootNav: false
			});
		},50)
	},

	//选择取证方式类别
	showEvidenceListCheck: function(e){
		this.setData({
			isCanScroll:true,
			isShowEvidenceList: false,
			evidenceName: e.target.dataset.name == this.data.evidenceName?'请选择取证方式': e.target.dataset.name,
			evidenceSelection: e.target.dataset.type == this.data.evidenceSelection?-1:e.target.dataset.type,
			isShowFootNav: true,
			isShowPoint: e.target.dataset.name == '办事处交证'?true:false
		});
	},

	//点击取证方式取消按钮取默认状态
	cancelBtnEvidenceSelection: function () {
		var that = this;
		setTimeout(function(){
			that.setData({
				evidenceName: '请选择取证方式',
				evidenceSelection: -1,
				isCanScroll: true,
				isShowEvidenceList: false,
				isShowFootNav: true,
				isShowPoint: false   //隐藏取证点
			});
		},50)
	},

	//点击mask隐藏香港签注类别列表
	hideEvidenceSelection: function () {
		var that = this;
		setTimeout(function(){
			that.setData({
				isCanScroll:true,
				isShowEvidenceList: false,
				isShowFootNav: true
			});
		},50)
	},
//点击取证方式图标显示取证方式列表 end

	//点击取证方式图标显示取证方式列表 start
	pointSelection: function (e) {
		var that = this;
		setTimeout(function(){
			that.setData({
				isCanScroll:false,
				isShowPointList: true,
				isShowFootNav: false
			});
		},50)
	},

	//选择取证点类别
	showPointListCheck: function(e){
		this.setData({
			isCanScroll:true,
			isShowPointList: false,
			pointName: e.target.dataset.name==this.data.pointName?'请选择取证点': e.target.dataset.name,
			pointSelection: e.target.dataset.type==this.data.pointSelection?-1:e.target.dataset.type,
			isShowFootNav: true
		});
	},

	//点击取证点取消按钮取默认状态
	cancelBtnPointSelection: function () {
		var that = this;
		setTimeout(function(){
			that.setData({
				pointName: '请选择取证点',
				pointSelection: -1,
				isCanScroll:true,
				isShowPointList: false,
				isShowFootNav: true
			});
		},50)
	},

	//点击mask隐藏取证点类别列表
	hidePointSelection: function () {
		var that = this;
		setTimeout(function(){
			that.setData({
				isCanScroll:true,
				isShowPointList: false,
				isShowFootNav: true
			});
		},50)
	},
//点击取证方式图标显示取证方式列表 end

	//点击香港图标显示香港类型列表 start
	hkSelection: function (e) {
		var that = this;
		setTimeout(function(){
			that.setData({
				isCanScroll: false,
				isShowHKList: true,
				isShowFootNav: false
			});
		},50)
	},

	//选择香港签注类别
	showHKListCheck: function(e){
		if(this.data.visaType==4){  //夫妻的只能选择一种地区类型
			this.setData({
				hkName: e.target.dataset.name==this.data.hkName?'请选择香港签注种类': e.target.dataset.name,
				hkSelection: e.target.dataset.type==this.data.hkSelection?-1:e.target.dataset.type, //选择的选项,后台需要的参数
				//夫妻类型只能选择一种类型
				amName: '请选择澳门签注种类',
				amSelection: -1 //选择的选项
			})
		}else {
			this.setData({
				hkName: e.target.dataset.name==this.data.hkName?'请选择香港签注种类': e.target.dataset.name,
				hkSelection: e.target.dataset.type==this.data.hkSelection?-1:e.target.dataset.type
			});
		}
		this.setData({
			isCanScroll: true,
			isShowHKList: false,
			isShowFootNav: true
		})
	},

	//点击取消按钮取默认状态
	cancelBtnHKSelection: function () {
		var that = this;
		setTimeout(function(){
			that.setData({
				hkName: '请选择香港签注种类',
				hkSelection: -1,
				isCanScroll:true,
				isShowHKList: false,
				isShowFootNav: true
			});
		},50)
	},

	//点击mask隐藏香港签注类别列表
	hideHKSelection: function () {
		var that = this;
		setTimeout(function(){
			that.setData({
				isCanScroll:true,
				isShowHKList: false,
				isShowFootNav: true
			});
		},50)
	},
	/*香港 end*/
	/*澳门 start*/
	//点击香港图标显示香港类型列表
	amSelection: function (e) {
		var that = this;
		setTimeout(function(){
			that.setData({
				isCanScroll:false,
				isShowAMList: true,
				isShowFootNav: false
			});
		},50)
	},

	//选择澳门签注类别
	showAMListCheck: function(e){
		if(this.data.visaType == 4){  //夫妻类型只能选择一种地区类型
			this.setData({
				amName: e.target.dataset.name==this.data.amName?'请选择澳门签注种类': e.target.dataset.name,
				amSelection: e.target.dataset.type==this.data.amSelection?-1:e.target.dataset.type,
				//夫妻类型只能选择一种类型
				hkName:'请选择香港签注种类',
				hkSelection: -1  //选择的下标
			});
		}else {
			this.setData({
				amName: e.target.dataset.name==this.data.amName?'请选择澳门签注种类': e.target.dataset.name,
				amSelection: e.target.dataset.type==this.data.amSelection?-1:e.target.dataset.type
			});
		}
		this.setData({
			isCanScroll:true,
			isShowAMList: false,
			isShowFootNav: true
		})
	},

	//点击取消按钮取默认状态
	cancelBtnAMSelection: function () {
		var that = this;
		setTimeout(function(){
			that.setData({
				amName: '请选择澳门签注种类',
				amSelection: -1,
				isCanScroll:true,
				isShowAMList: false,
				isShowFootNav: true
			});
		},100)
	},

	//点击mask隐藏香港签注类别列表
	hideAMSelection: function () {
		var that = this;
		setTimeout(function(){
			that.setData({
				isCanScroll:true,
				isShowAMList: false,
				isShowFootNav: true
			});
		},50)
	},
	/*澳门 end*/

	//选择城市取消按钮
	cancelAddressTap:function (e) {
		this.setData({
			isAddressShow: false,
			isShowFootNav: true
		});
	},

	//显示地址组件
	areaTap:function (e) {
		this.setData({
			isAddressShow: true,
			isShowFootNav: false
		});
	},

	// 收件人地址组件start
	//显示收件人地址组件
	locationTap: function (e) {
		this.setData({
			isLocationShow: true,
			isShowFootNav: false
		});
	},

	//选择收件人取消按钮
	cancelLocationTap:function (e) {
		this.setData({
			isLocationShow: false,
			isShowFootNav: true
		});
	},

	//隐藏清远地区提示框mask
	hideMask: function (e) {
		this.setData({
			maskIsShow: false
		})
	},

	//选择收件人确定按钮
	confirmLocationTap: function (e) {
		var current_value = this.data.value;
		var provinceName = this.data.proviceData[current_value[0]].name;
		var cityName = this.data.cityData[current_value[1]].name;
		var countyName = "";
		if(this.data.districtData[current_value[2]].name!=null){
			countyName = this.data.districtData[current_value[2]].name;
		}

		this.setData({
			isShowFootNav:true,
			isLocationShow: false
		})

		this.setData({
			locationStyle:"color:#1a1a1a;font-size:34rpx",
			locationArea:provinceName+cityName+countyName,
			"locationAreaProvinceId":this.data.proviceData[current_value[0]].id,
			"locationAreaCityId":this.data.cityData[current_value[1]].id,
			"locationAreaCountyId":this.data.districtData[current_value[2]].id,
			"locationAreaProvinceName":provinceName,
			"locationAreaCityName":cityName,
			"locationAreaCountyName":countyName
		});
	},
	// 收件人地址组件end

	//选择户籍城市确定按钮
	confirmAddressTap:function (e) {
 	    	var current_value = this.data.hkHouseValue;
        var provinceName = this.data.hkHouseProviceData[current_value[0]].name;
        var cityName = this.data.hkHouseCityData[current_value[1]].name;
        var countyName = "";
        if(this.data.hkHouseDistrictData[current_value[2]].name!=null){
            countyName = this.data.hkHouseDistrictData[current_value[2]].name;
        }
        this.setData({
	        isShowFootNav:true,
	        isAddressShow: false
        })

        if(this.data.visaType==1||this.data.visaType==2||this.data.visaType==4||this.data.visaType==5){  //个人自由行 湖南 夫妻 深圳 户籍
	        this.setData({
		        areaStyle:"color:#1a1a1a;font-size:34rpx",
		        area:provinceName+cityName+countyName,
		        "address.provinceId":this.data.hkHouseProviceData[current_value[0]].id,
		        "address.cityId":this.data.hkHouseCityData[current_value[1]].id,
		        "address.countyId":this.data.hkHouseDistrictData[current_value[2]].id,
		        "address.provinceName":provinceName,
		        "address.cityName":cityName,
		        "address.countyName":countyName
	        });

	        if(cityName.indexOf('深圳')>-1){
		        var postData={
			        bizProvinceId: this.data.bizProvinceId,
			        bizType: this.data.visaType
		        }
		        this.getRegionType(postData,false); //如果是深圳用户显示一年多次 没有第三个参数代表页面默认值不用更改
	        }else {
		        var postData={
			        bizProvinceId: this.data.bizProvinceId,
			        bizType: this.data.visaType   //如果缓存为空，取自由行
		        }
		        this.getRegionType(postData,true); //true不显示一年多次  没有第三个参数代表页面默认值不用更改
		        if(this.data.hkName=='一年多次'){ //先选深圳地区选一年多次，再选非深圳第地区，清空
			        this.setData({
				        hkName: '请选择香港签注种类',  //默认文字
				        hkSelection: -1 //选项
			        })
		        }
	        }
        }else if(this.data.visaType==3){  //商务行 组织所在地
	        this.setData({
		        organizationAreaStyle:"color:#1a1a1a;font-size:34rpx",
		        organizationArea:provinceName+cityName+countyName,
		        "organizationAddress.provinceId":this.data.hkHouseProviceData[current_value[0]].id,
		        "organizationAddress.cityId":this.data.hkHouseCityData[current_value[1]].id,
		        "organizationAddress.countyId":this.data.hkHouseDistrictData[current_value[2]].id,
		        "organizationAddress.provinceName":provinceName,
		        "organizationAddress.cityName":cityName,
		        "organizationAddress.countyName":countyName
	        });
        }

	},
	//省市区滑动事件
  bindHkHouseChange: function (e) {
		app.bindHkHouseChange(e);
	},
	//省市区滑动事件
	bindAddressChange: function (e) {
		app.bindAddressChange(e);
	}
});
